home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 July / macformat-026.iso / mac / Shareware City / Developers / WASTE Object Handlers v1.0 ƒ / Handler Source / WE_PICT_Handler.c < prev    next >
Encoding:
Text File  |  1995-03-12  |  1.0 KB  |  56 lines  |  [TEXT/MPCC]

  1. // PICT Object Handler for the WASTE Text Engine
  2. // by Michael F. Kamprath, kamprath@earthlink.net
  3. //
  4. // v1.0, 12 March 1995
  5. //
  6.  
  7. #include "WASTE.h"
  8. #include "WE_PICT_Handler.h"
  9. #include "WASTE_Objects.h"
  10.  
  11. //
  12. // New Object Handler for PICTs
  13. //
  14. pascal OSErr    HandleNewPicture(Point *defaultObjectSize,WEObjectReference objectRef)
  15. {
  16. PicHandle    thePic;
  17. Rect        theFrame;
  18.  
  19.     thePic = (PicHandle)WEGetObjectDataHandle(objectRef);
  20.     
  21.     theFrame = (*thePic)->picFrame;
  22.     
  23.     OffsetRect(&theFrame, -theFrame.left, -theFrame.top);
  24.     
  25.     *defaultObjectSize = botRight(theFrame);
  26.         
  27.     return(noErr);
  28. }
  29.  
  30. //
  31. // Dispose Object Handler for PICTS
  32. //
  33. pascal OSErr    HandleDisposePicture(WEObjectReference objectRef )
  34. {
  35. PicHandle    thePic;
  36.  
  37.     thePic = (PicHandle)WEGetObjectDataHandle(objectRef);
  38.     
  39.     if (thePic)
  40.         KillPicture(thePic);
  41.  
  42.     return(MemError());
  43. }
  44. //
  45. // Draw Object Handler for PICTs
  46. //
  47. pascal OSErr    HandleDrawPicture (Rect *destRect, WEObjectReference objectRef )
  48. {
  49. PicHandle    thePic;
  50.     
  51.     thePic = (PicHandle)WEGetObjectDataHandle(objectRef);
  52.  
  53.     DrawPicture(thePic, destRect);
  54.             
  55.     return( noErr );
  56. }